<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" async 
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<!-- SYNTAX HIGHLIGHTING CLASSES  -->
<style type="text/css">
.author {display:block;text-align:center;font-size:16px;margin-bottom:3px;}
.date {display:block;text-align:center;font-size:12px;margin-bottom:3px;}
.center, #center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    -webkit-box-shadow: 0px 0px 2px rgba( 0, 0, 0, 0.5 );
    -moz-box-shadow: 0px 0px 2px rgba( 0, 0, 0, 0.5 );
    box-shadow: 0px 0px 2px rgba( 0, 0, 0, 0.5 );

    padding: 0px;
    border-width: 0px;
    border-style: solid;
    cursor:-webkit-zoom-in;
    cursor:-moz-zoom-in;
    }

pagebreak {
        page-break-before: always;
        }

.pagebreak, #pagebreak {
        page-break-before: always;
        }

td > p {padding:0; margin:0;}




header {
        font-size:28px;
        padding-bottom:5px; 
        margin:0;
        padding-top:150px; 
        font-family: ;
        background-color:white; 
        text-align:center;
        display:block;
        }

table {
        border-collapse: collapse;
        border-bottom:1px solid black;
        padding:5px;
        margin-top:5px;

}
.tble {
        display:block;
        margin-top: 10px;
        margin-bottom: 0px;
        margin-bottom: 0px;
}

.tblecenter {
        display:block;
        margin-top: 10px;
        margin-bottom: 0px;
        margin-bottom: 0px;
        text-align:center;
}

span.tblecenter + table, span.tble + table, span.tble + img {
        margin-top: 2px;
}

th {
border-bottom:1px solid black;
border-top:1px solid black;
padding-right:20px;
}

td {
padding-right:20px;
}

</style>
<script type="text/javascript" src='http://haghish.com/statax/Statax.js'></script>
</head>
<body>
<pre class="sh_stata">  . capture quietly log close</pre>
<pre class="sh_stata">  . quietly log using example, replace </pre>
<h1 id="rundoc-command"><code>rundoc</code> command</h1>
<p>The <a href="https://github.com/haghish/MarkDoc"><code>markdoc</code></a> command takes a <code>SMCL</code> log file to create a dynamic document or presentation slides. This procedure requires the user to create a log file and convert it to a dynamic document.</p>
<p>The <strong><code>rundoc</code></strong> command, is simply a wrapper for MarkDoc to simplifies typesettinf dynamic documents directly from a Stata do-file, without requiring the do-file to include a log file.</p>
<p>The syntax for writing comments remains identical to <a href="https://github.com/haghish/MarkDoc"><code>markdoc</code></a> command. This command should make executing dynamic documents much simpler!</p>
<h2 id="features">Features</h2>
<h3 id="executing-stata-commands">executing Stata commands</h3>
<p>The <strong><code>rundoc</code></strong> command preserves all of the features of <code>markdoc</code>, because it is simply a wrapper program. Therefore, it preserves all of the features of <code>markdoc</code> such as executing Stata commands and syntax highlighting of the Stata commands using <a href="https://github.com/haghish/statax"><code>statax</code></a> package:</p>
<pre class="sh_stata">  .  display "Hello MarkDoc"</pre>
<pre><code>      Hello MarkDoc
      </code></pre>
<pre class="sh_stata">  . sysuse auto, clear</pre>
<pre><code>      (1978 Automobile Data)
      </code></pre>
<pre class="sh_stata">  . summarize </pre>
<pre><code>          Variable |        Obs        Mean    Std. Dev.       Min        Max
      -------------+---------------------------------------------------------
              make |          0
             price |         74    6165.257    2949.496       3291      15906
               mpg |         74     21.2973    5.785503         12         41
             rep78 |         69    3.405797    .9899323          1          5
          headroom |         74    2.993243    .8459948        1.5          5
      -------------+---------------------------------------------------------
             trunk |         74    13.75676    4.277404          5         23
            weight |         74    3019.459    777.1936       1760       4840
            length |         74    187.9324    22.26634        142        233
              turn |         74    39.64865    4.399354         31         51
      displacement |         74    197.2973    91.83722         79        425
      -------------+---------------------------------------------------------
        gear_ratio |         74    3.014865    .4562871       2.19       3.89
           foreign |         74    .2972973    .4601885          0          1
      
      </code></pre>
<h3 id="writing-mathematical-notations">Writing mathematical notations</h3>
<p>Mathematical notations are supported in PDF, HTML, Docx, ODT (OpenOffice), and LaTeX:</p>
<p><span class="math display">\[ Y = \beta_{0} + \beta_{1}x_{1} + \epsilon \]</span></p>
<pre class="sh_stata">  .  quietly log close</pre>
</body>
</html>
